<?php 

//$type = db::getTableFieldType("page", "[property]");
//echo $type;

$type = "text";

if ($type == "longtext") {
    
    
    global $pageTable;

$languageTmp    ="";
//$contentFilename="/code/content/{$pageTable}_[property]_{$cmsData['page_id']}.php";
$contentFilename="$codePath/{$pageTable}_[property]_{$cmsData['page_id']}.php";

//echo $contentFilename;

global $webEditUserGroup;

if (file::fileExists($contentFilename))
    {
    //global $rootDir;
    //include ($rootDir.$contentFilename);       //$languageTmp

  /*  global $domainModus;
    if ($domainModus)
        {
        global $domain;
        include("../code/$domain/content/{$pageTable}_[property]_{$cmsData['page_id']}.php");
        }
    else
        {
            global $rootDir;
            include("$rootDir/code/content/{$pageTable}_[property]_{$cmsData['page_id']}.php");
        
            
            //include("../code/content/{$pageTable}_[property]_{$cmsData['page_id']}.php");
        }*/
   
        global $rootDir; 
        include($rootDir.$codePath."/{$pageTable}_[property]_{$cmsData['page_id']}.php");            
    
    
    }
else
    {
    //  echo $cmsData['text'];
    echo "<p>Error: Kein Content File gefunden. File: $contentFilename</p>";
    }

global $webEditUserGroup;

if ($userData['_' . $usergroupTable] >= $cmsData['_' . $usergroupTable . '_edit'])
    {
    
 
        
        
        
        // falls Web Administrator
         if ($userData['_usergroup'] >= 40) {  
                echo '<p class="edit_button"><a class="snapol_button" href="/admin/ajax-editor?table=' . $pageTable . '&id2=' . $cmsData['page_id2'] . '">
                    Ajax Edit</a></p>';
         }


        // ruft den normalen Editor auf
        $url = "/admin/snapol-editor?table=$pageTable&id2={$cmsData['page_id2']}";
        
        // falls Modul
        if (isset($_REQUEST['_modul']))
            $url = $url."&_modul={$_REQUEST['_modul']}";
        
        
         
   
        echo '<p class="edit_button"><a class="snapol_button" href="'.$url.'">
                Editieren</a></p>';                
                
       /*echo '<p class="edit_button"><a class="snapol_button" href="/snapol/editor/index.php?table=' . $pageTable . '&id2=' . $cmsData['page_id2'] . '">
                Ajax Edit</a></p>';*/
                
       /*        if ($webEditUserGroup>40) {
                echo '<p class="edit_button"><a class="snapol_button" href="/snapol/ajaxEdit?table=' . $pageTable . '&field=[property]' . $languageTmp . '&id2=' . $cmsData['id2'] . '&id=' . $cmsData['id'] . '&title=' . $cmsData['titel'] . '">
                        Editieren (Ajax)</a></p>';  
                 echo '<p class="edit_button"><a class="snapol_button" href="/snapol/edit?table=' . $pageTable . '&field=[property]' . $languageTmp . '&id=' . $cmsData['id'] . '&title=' . $cmsData['titel'] . '">
                    Editieren (Html)</a></p>';               
                                
            } */

    }
    
    
    
    
} else {
    
 
 // falls Title, Abfrage, ob Titel angezeigt werden soll
 if ("[property]" == "title") {
  
  if ($cmsData['title_active'])
       echo $cmsData['[property]'];       
     
 } else {
       echo $cmsData['[property]'];       
 }

    
}



?>